﻿#include <QTextCodec>
#include "QLuoshuApplication.h"
#include "QAppDebugWin.h"
#include "mainwindow.h"
#include <QSettings>

int main(int argc, char *argv[])
{
    QTextCodec *utg8 = QTextCodec::codecForName("utf-8");
    QTextCodec::setCodecForTr(utg8);
    QTextCodec::setCodecForLocale(utg8);
    QTextCodec::setCodecForCStrings(utg8);

    QLuoshuApplication app(argc, argv);
    app.installDebugHandler();

    QAppDebugWin* dbgWin = new QAppDebugWin(0);
    dbgWin->show();
    app.connect(&app,SIGNAL(incomingMsg(QtMsgType,QString)),dbgWin
                ,SLOT(on_debugMsg_incoming(QtMsgType,QString)));
	
    Q_INIT_RESOURCE(QLuoshu);

    MainWindow mainWin;

	// can show the messages from here
	qDebug( "starting...");

    mainWin.show();
    return app.exec();
}
